#!/bin/gawk -f
#
# check PseudoLIB-aqua (file on input) by removing type number from
# /usr/rhino/people/rull/aquad/data_old5/PseudoLIB-aqua
#
# Note: the ordering produced by mdf2PseudoLIB is different - could change 
# order in TEST.mdf and remove "sort" command from mdf2PseudoLIB
#
BEGIN {
    oldfil = "/usr/rhino/people/rull/aquad/data_old5/PseudoLIB-aqua"
    while ( getline < oldfil ) {
	org[++count] = $0
	sub( / [0-9] /, " 0 " )
	sto[count] = $0
    }
    doit = 0
}

/BEGIN_DATA/ {
    doit = 1
    next
}

!doit {
    print $0
    next
}

doit {
    for ( i=1; i<=count; i++ ) {
	if ( sto[i] == $0 ) {
	    print org[i]
	    next
	}
    }
    print $0
}
